Memory API Reference
The Memory API provides agents with persistent conversational context across multiple interactions. While language models only receive the current prompt, memory providers allow BindAI agents to remember previous messages, user preferences, and conversation history. This page documents the public Memory API.Overview
Memory stores information beyond a single request. Conceptually:Purpose
Memory enables agents to:- remember previous conversations
- preserve user context
- personalize responses
- retrieve historical interactions
- maintain long-running conversations
Memory Providers
BindAI separates memory through providers.Assigning Memory
Memory is typically attached to an agent. Conceptually:Reading Memory
Before generating a response, the agent retrieves previous messages.Writing Memory
After responding, the interaction is stored.Conversation History
A memory provider typically stores a sequence of messages.Session Isolation
Memory is generally organized by conversation or session.Persistence
Some memory providers persist data. Others keep it only during runtime. Examples include:- in-memory storage
- databases
- key-value stores
- cloud storage
- custom implementations
Clearing Memory
Applications may clear conversation history when appropriate. Typical situations include:- user logout
- conversation reset
- testing
- privacy requests
Memory vs Knowledge
Memory and knowledge solve different problems.
Agents often use both together.
Memory in Workflows
Workflow nodes may also access shared conversation memory.Error Handling
Memory providers should gracefully handle:- unavailable storage
- missing conversations
- corrupted data
- connection failures
Performance
Efficient memory providers should:- retrieve only relevant history
- avoid unnecessary database queries
- support scalable storage
- minimize serialization overhead
Security
Conversation memory may contain sensitive information. Providers should:- encrypt stored data when appropriate
- isolate user sessions
- respect privacy policies
- support data deletion
- restrict unauthorized access
Best Practices
- Use memory only when conversational continuity is required.
- Keep sessions isolated.
- Limit the amount of retrieved history.
- Store only necessary information.
- Clear memory when conversations end.
- Choose a provider appropriate for your deployment.
- Combine memory with knowledge retrieval when needed.
Related APIs
The Memory API integrates with:- Agent
- Project
- Workflow
- Knowledge
- Provider
